Imports System.Collections.ObjectModel
Imports OMANE.Common.Model.Interfaces
Imports Actuariat
Imports PTIC_GestionBDD


Public Class TableINCINV_TxFromDataTable
    Implements ITableMaintienINCINV_Tx

    Public Sub New(ByVal DtbleINCINV_Tx As DataTable, ByVal NomTable As String)
        m_Nom = NomTable
        m_DataTAble = DtbleINCINV_Tx
    End Sub

    Private m_Nom As String
    Public ReadOnly Property Nom As String Implements Actuariat.ITableTravail.Nom
        Get
            Return m_Nom
        End Get
    End Property

    Private m_DataTAble As DataTable
    Public ReadOnly Property DataTable As System.Data.DataTable Implements Actuariat.ITableMaintienINCINV_Tx.DataTable
        Get
            Return m_DataTAble
        End Get
    End Property

    Public ReadOnly Property ProbaMaintien(ByVal NbMoisCouverture As Integer, ByVal AgeSous As Integer) As Double Implements Actuariat.ITableMaintienINCINV_Tx.ProbaMaintien
        Get
            If AgeSous <= 64 Then
                Return m_DataTAble.Rows(NbMoisCouverture - 1)(AgeSous - 17)
            Else
                Return m_DataTAble.Rows(NbMoisCouverture - 1)(64)
            End If
        End Get
    End Property
End Class
